import React from 'react'
import { Tabs } from 'antd'
import '../../../less/index.less'
import SectionView from './section-view'
import * as tabSection from '../../../constant/tab-section'
import { FormattedMessage } from 'react-intl'

const TabPane = Tabs.TabPane

const SectionListBox = ({ results }) => {
  return (
    <Tabs defaultActiveKey='1'>{
      tabSection.typeStatus.map((tab, index) => {
        return <TabPane tab={<FormattedMessage id={tab.type} />} key={index + 1}>
          {tab.length === 0
            ? `您当前没有作业`
            : <SectionView results={results} status={tab.status} />
          }
        </TabPane>
      })

    }

    </Tabs>)
}

export default SectionListBox
